package com.spider.moudle.api.realize;

import com.spider.moudle.api.Consumer;
import com.spider.moudle.util.PropertiesUtil;

/**
 * Created by Linbo Hu on 2017/12/18.
 * 一个标准的消费者
 */
public abstract class AbstractConsumer implements Consumer {

    @Override
    public void run() {
        String workMode = PropertiesUtil.getVal("spider.work.mode");
        switch (workMode) {
            case "SPEECH": {
                speech();
                break;
            }
            case "USER": {
                user();
                break;
            }
            case "BOTH": {
                speech();
                user();
                break;
            }
            default: {
                System.out.println("the value of spider.work.mode is unavailable");
            }
        }
    }
}
